<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="${ctx}/res/css/question.css">
<script type="text/javascript" src="${ctx}/res/js/survey/surveyVote/voteEdit.js"></script>
<script type="text/javascript" src="${ctx}/res/js/survey/surveyVote/voteCommon.js"></script>
<title>question</title>
</head>
<body>
	<div class="question-container" id="questionContainer">
		<form id="questionForm" method="post"
			action="${ctx}/surveyVote/updateVote.do">
			<div id="printer">
				<div class="question-title">··········${survey.surveyName}··········</div>
				<div class="question-content"
					style="border-radius: 5px; box-shadow: lightblue 1px 1px 1px 1px; margin-bottom: 30px;">
					 <br>
					${survey.remark}
				</div>
				<c:forEach items="${list}" var="qt">
					<c:choose>
						<c:when test="${qt.questionType==3}">
							<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}</div>
							<div class="item1 question-option2">
								<input type="text" id="${qt.id}" name="${qt.id}"
									value="${qt.questionValue}" class="required needCommitInput" maxlength="10"
									placeholder="请输入长度不超过10位的字符" />
							</div>
							<hr class='question-separator'></hr>
						</c:when>
						<c:when test="${qt.questionType==1}">
							<div id="${qt.id}">
								<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}
									(单选)<em>*</em>
								</div>
								<span class="validateError"></span>
								<div class="item1">
									<c:forEach items="${qt.questionOptionList}" var="qo">
										<div class="question-option">
											<div class="${qo.optionValue} uncheck"
												onclick="setQuestionValue('${qt.questionType}','${qt.id}','${qo.optionValue}')">${qo.optionValue}
								. ${qo.optionName}</div>
											<input type="hidden" class="selectResult"
												value="${qo.checkValue}" />
										</div>
									</c:forEach>
									<input id="${qt.id}" name="${qt.id}" type="hidden"
										value="${qt.questionValue}" class="needValidate needCommitInput"/>
									<hr class='question-separator'></hr>
								</div>
							</div>
						</c:when>
						<c:when test="${qt.questionType==2}">
							<div id="${qt.id}">
								<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}
									(多选)<em>*</em>
								</div>
								<span class="validateError"></span>
								<div class="item1">
									<c:forEach items="${qt.questionOptionList}" var="qo">
										<div class="question-option">
											<div class="${qo.optionValue} uncheck"
													onclick="setQuestionValue('${qt.questionType}','${qt.id}','${qo.optionValue}')">${qo.optionValue}
								. ${qo.optionName}</div>
											<input type="hidden" class="selectResult"
													value="${qo.checkValue}" />
										</div>
									</c:forEach>
									<input id="${qt.id}" name="${qt.id}" class="needValidate needCommitInput"
										type="hidden" value="${qt.questionValue}" />
									<hr class='question-separator'></hr>
								</div>
							</div>
						</c:when>
						<c:when test="${qt.questionType==4}">
							<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}</div>
							<div class="item1 question-option2">
								<textarea cols="10" rows="10" id="${qt.id}" name="${qt.id}"
									class="required" maxlength="60" placeholder="请输入长度不超过60位的字符"  style="height:80px;" >${qt.questionValue}</textarea>
							</div>
							<hr class='question-separator'></hr>
						</c:when>
						<c:when test="${qt.questionType==5}">
							<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}<em>*</em>
							</div>
							<span class="validateError"></span>
							<div class="item1 question-option5">
								<div class="toolButton" onclick="numDec($(this))"
									style="min-width: 45px; line-height: 25px; padding: 1px 1px 1px 1px;">Dec</div>
								<input type="text" id="${qt.id}" name="${qt.id}"
									value="${qt.questionValue}" class="required needCommitInput"
									style="width: 50px;" valmax="${qt.maxVal}"
									valmin="${qt.minVal}" onkeyup="numInput($(this))" onpaste="return numPaste($(this))"/>
								<div class="toolButton" onclick="numAdd($(this))"
									style="min-width: 45px; line-height: 25px; padding: 1px 1px 1px 1px;">Add</div>
							</div>
							<hr class='question-separator'></hr>
						</c:when>
						<c:when test="${qt.questionType==6}">
							<div id="${qt.id}">
								<div class="question-content">${qt.questionOrder}
								. ${qt.questionContent}<em>*</em>
								</div>
								<div class="item1">
								    <span class="validateError"></span>
									<div class="item1 question-option2">
										<c:forEach items="${qt.questionOptionList}" var="qo">
			                            	<c:if test="${qo.checkValue==true}">
				                            	<c:if test="${qo.optionName=='Y'}">
				                            		<input value="1" checked="checked" style="width: 60px" type="radio" name="${qt.id}"  class="needValidate needCommitInput"/>${qo.optionName}			  
				                            	</c:if>
				                            	<c:if test="${qo.optionName=='N'}">
			                            			<input value="0" checked="checked" style="width: 60px" type="radio" name="${qt.id}"  class="needValidate needCommitInput"/>${qo.optionName}			  
			                            		</c:if>
			                            	</c:if>
			                            	<c:if test="${qo.checkValue==false}">
				                            	<c:if test="${qo.optionName=='Y'}">
				                            		<input value="1" style="width: 60px" type="radio" name="${qt.id}"  class="needValidate needCommitInput"/>${qo.optionName}			  
				                            	</c:if>
				                            	<c:if test="${qo.optionName=='N'}">
			                            			<input value="0" style="width: 60px" type="radio" name="${qt.id}"  class="needValidate needCommitInput"/>${qo.optionName}			  
			                            		</c:if>
			                            	</c:if>
			                            </c:forEach>
									</div>
								</div>
							</div>
						</c:when>
					</c:choose>
				</c:forEach>
			</div>
			<p style="text-align: center">
			<center>
				<c:choose>
					<c:when test="${thisType=='alreadyVote'}">
						<div class="toolButton" onclick="submitQuestionForm();">确定</div>
					</c:when>
				</c:choose>
				<div class="toolButton" onclick="cancelButton();">取消</div>
			</center>
			</p>
		</form>
	</div>
	<form id="loadSurveyList" method="post" action="${ctx}/survey/surveyList/loadSurveyList.do">
		<input type="hidden" name="type" value="alreadyVoted"/>
		<input type="hidden" name="currentPage" value="${currentPage}"/>
	</form>
	<form id="submitcurrentpage" method="post" action="${ctx}/survey/surveyList/loadSurveyList.do">
			<input type="hidden" name="pageType" value="lastest"/>
			<input type="hidden" name="type" value="${type}"/>
    </form>
    <form id="submitcurrentpage1" method="post" action="${ctx}/survey/surveyManagement/surveyList.do">
			<input type="hidden" name="pageType" value="lastest"/>
    </form>
</body>
</html>